//
//  NetWorkModel.m
//  JKFuYinProject
//
//  Created by admin on 2018/5/21.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "NetWorkModel.h"

@implementation NetWorkModel

- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (id)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }
- (id)copyWithZone:(NSZone *)zone { return [self yy_modelCopy]; }

- (NSUInteger)hash { return [self yy_modelHash]; }
- (BOOL)isEqual:(id)object { return [self yy_modelIsEqual:object]; }

- (NSString *)description { return [self yy_modelDescription]; }


+ (id)lc_getCachePOSTWithFileName:(NSString *)fileName {
    NSDictionary *dict = [self lc_dictWithPlist:fileName];
    NetWorkModel *netWorkModel = [NetWorkModel yy_modelWithJSON:dict];
    return netWorkModel;
}

+ (id)lc_dictWithPlist:(NSString *)plistName{
//    plistName = [plistName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    //NSURL *url = [[NSBundle mainBundle] URLForResource:plistName withExtension:nil];
    NSArray *array = [plistName componentsSeparatedByString:@"."];
    NSString *file = [[NSBundle mainBundle] pathForResource:array[0] ofType:array[1]];
    if (file == nil){[SVProgressHUD showErrorWithStatus:@"读取测试文件错误"];}
    NSAssert(nil != file, @"url_err  plist文件不对");
    NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:file];
    return dict;
}

@end
